/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package op;

import java.util.Comparator;

/**
 *
 * @author Jonatas
 */
public class ComparatorLigacaoOrigemEPlano implements Comparator<Ligacao> {

    public int compare(Ligacao o1, Ligacao o2) {

        if(o1.getNumeroDeOrigem().equals(o2.getNumeroDeOrigem())) {
            return o1.getPlanoLigacao().compareTo(o2.getPlanoLigacao());
        }

        return o1.getNumeroDeOrigem().compareTo(o2.getNumeroDeOrigem());
    }

}
